import spock.lang.Specification

/**
 * Created at 2017/11/7 19:57
 * @author gongweixin
 */
class GetSetExample extends Specification {

    def "static get"() {
        expect:
        1 == T.count
    }

    def "no static get"() {
        expect:
        1 == new T()._count
    }

    static class T {
        static int count = 0

        static int getCount() {
            return count + 1
        }


        int _count = 0

        int get_count() {
            return _count + 1
        }
    }
}
